<template>
  <h2 class="title"><img src='./assets/vuelogo.png'>Vue3 learning</h2>
  <div class="content">
    <main-side-bar class="mainsidebar"></main-side-bar>
    <div class="client">
      <router-view/>
      <!-- 顶级路由指向的命名视图只有放在App.vue里才有效果?! -->
      <router-view name="one"></router-view>
      <router-view name="two"></router-view>
      <router-view name="three"></router-view>
    </div>
  </div>
</template>

<script>
import MainSideBar from 'views/main/MainSideBar'

export default {
  name: 'App',
  components: {
    MainSideBar
  }
}
</script>

<style>

  .title {
    position: relative;
    width: 100%;
    height: 40px;
    font-size: 22px;
    text-align: center;
    margin: 0;
    background-color: #eee;
  }

  .title img {
    width: 32px;
    height: 32px;
    vertical-align: middle;
    margin-right: 10px;
  }

  .content {
    margin-top: 2px;
    position: relative;
    height: calc(100% - 40px);
  }

  .mainsidebar {
    position: fixed;
    height: calc(100% - 48px);
    width: 240px;
    border: 1px solid #eee;
  }

  .client {
    margin-left: 246px;
    position: relative;
    border: 1px solid #fff;
  }

</style>
